<template>
  <div class="exhibits-content" :style="{ width: props.info.width + 'rem', height: props.info.height + 'rem' }">
    <div class="list">
      <div
        class="boardleft-parent"
        :style="{
          backgroundImage: `url(${
            publicUrls + 'free/style12/exhibitionStandStyle1bg1sendLeft.webp'
          })`,
        }"
      >
        <img class="boardleft" :src="publicUrls + 'free/style12/exhibitionStandStyle1bg1sendLeft1.webp'" alt="" />
      </div>
      <div class="list-content">
        <div
          class="list-left"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style12/exhibitionStandStyle1bg1.webp'})`,
          }"
        >
          <div
            class="list-left-shadow"
            :style="{
              backgroundImage: `url(${
                publicUrls + 'free/style12/exhibitionStandStyle1bg1shadow1.webp'
              })`,
            }"
          ></div>
        </div>
        <div
          @contextmenu.stop="emit('onContextMenuChild', $event, index)"
          v-for="(item, index) in props.info.showpieceList"
          :key="index"
          class="exhibits-item"
          :class="{
            'exhibits-item-one': index === 0,
            'exhibits-item-2': (index + 1) % 2 === 0,
          }"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style12/exhibitionStandStyle1bg2.webp'})`,
          }"
        >
          <div
            class="list-item-shadow"
            :style="{
              backgroundImage: `url(${
                publicUrls + 'free/style12/exhibitionStandStyle1bg1shadow2.webp'
              })`,
            }"
          ></div>
          <div class="item-content" @click="viewImg(item.moduleId, item.id)">
            <div
              class="item-shadow"
              :style="{
                backgroundImage: `url(${
                  publicUrls + 'free/style12/exhibitionStandStyle1bg4.webp'
                })`,
              }"
            ></div>
            <div class="cover-parent">
              <div class="cover-box">
                <div class="cover">
                  <img v-lazy="getLinkUrl(item.coverUrl, '?imageView2/3/w/600/format/webp')" alt="" />
                  <!-- <FlowerCom /> -->
                </div>
              </div>
            </div>
          </div>
          <div class="items-title">
            {{ item.name }}
          </div>
        </div>
        <div
          class="list-right"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style12/exhibitionStandStyle1bg3.webp'})`,
          }"
        >
          <div
            class="list-right-shadow"
            :style="{
              backgroundImage: `url(${
                publicUrls + 'free/style12/exhibitionStandStyle1bg1shadow3.webp'
              })`,
            }"
          ></div>
        </div>
      </div>
    </div>
  </div>
</template> 
   
<script setup lang="ts">
import FlowerCom from '../../displayBoard/style12/flower.vue';
import { publicUrls } from '@/utils/minxin';
import { DraggableContainer } from 'vue3-draggable-resizable';
// import FlotMenu from '@/components/flotMenu/OutlineMenu.vue';
import ContextMenu from '@imengyu/vue3-context-menu';
import { getDraggableNumber, getExhibitsHeightRest, getdisabledY } from '@/utils/getRemComputed';
import { ref, reactive, watch, nextTick } from 'vue';
import { exbitMenuShow, exbitListMenuShow } from '@/hooks/menuHooks';
import { useProjectStore } from '@/store';
import { getLinkUrl } from '@/utils/request/upload';

const emit = defineEmits([
  'emitChildItemDraggable',
  'emitChildItemDraggableStyle',
  'emitShowcaseDraggable',
  'emitShowcaseDraggableStyle',
  'onContextMenuChild',
]);
const store = useProjectStore();
const contextMenuTrigger = ref(); //列表盒子dom
const parentLock = ref(true);
const childShow = ref(true);
const draggableResizable = ref(); //父级拖拽盒子ref
const timer = ref();
const ImgVisible = ref(false);
const ImgUrl = ref('');

const props = defineProps({
  width: {
    type: Number || String,
  },
  height: {
    type: Number || String,
  },
  indexs: {
    type: Number,
  },
  info: {
    type: Object,
  },
  childId: {
    type: Number,
  },
  AuxiliaryId: {
    type: Number,
  },
});

const viewImg = (moduleId: number, e?: number) => {
  store.exhibitsModuleId = moduleId;
  store.exhibitsShowpieceid = e;
  store.exhibitsInfoShow = true;
};

const handleMouseDown = (event) => {
  event.stopPropagation();
};
const preventDefaultDrag = (event) => {
  event.stopPropagation();
};
</script>
   
<style lang="less" scoped>
.exhibits-content {
  position: relative;
  display: flex;
  z-index: 999;
}
.list {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 0 0.05rem;
}
.boardleft-parent {
  display: flex;
  // justify-content: center;

  align-items: center;
  width: 339px;
  height: 330px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  margin-top: 0px;
  margin-right: 13px;
  -webkit-box-reflect: below 340px linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.boardleft {
  width: 187px;
  height: 169.5px;
  object-fit: contain;
  transition: all 0.3s;
  margin-left: 72px;
}
.boardleft:hover {
  transform: rotate(180deg);
}
.list-content {
  margin-top: 125px;
  display: flex;
  align-items: flex-end;
  flex: 1;
  height: 594px;
  // -webkit-box-reflect: below -0px linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.list-left {
  position: relative;
  width: 45px;
  height: 594px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.list-right {
  position: relative;
  width: 30px;
  height: 594px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.active {
  :deep(.flot-menu) {
    display: flex;
  }
}
:deep(.active) {
  z-index: 999;
}
:deep(.vdr-handle) {
  z-index: 66;
}

.exhibits-item {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 296px;
  height: 594px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 141px 16px 0px 6px;
}
// .exhibits-item-one {
//   margin-left: 0;
// }
// .exhibits-item-2 {
//   width: 289px;
//   height: 627px;
//   padding: 109px 1px 325px 90px;
// }
.item-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 274px;
  height: 240px;
  background: rgba(247, 90, 78, 1);
}
.item-shadow {
  position: absolute;
  top: 6px;
  left: 4px;
  width: 266px;
  height: 228px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  z-index: 3;
}
.cover-parent {
  width: 274px;
  height: 240px;
}
.cover-box {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 274px;
  height: 240px;
  overflow: hidden;
}
.cover {
  position: relative;
  width: 274px;
  height: 184px;
  object-fit: contain;
  transition: all 0.3s;
  overflow: hidden;
  img {
    width: 100%;
    height: 184px;
    object-fit: contain;
    transition: all 0.3s;
  }
}
.item-content:hover {
  .cover {
    img {
      transform: scale(1.2);
    }
  }
}
.items-title {
  margin-top: 5px;
  width: 221px;
  height: 30px;
  font-family: PingFang SC;
  font-size: 16px;
  font-weight: 400;
  line-height: 30px;
  text-align: center;
  color: rgba(254, 214, 129, 1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-left: 26px;
}
.list-left-shadow {
  position: absolute;
  top: 594px;
  left: 0px;
  height: 594px;
  width: 45px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  z-index: -1;
}
.list-item-shadow {
  position: absolute;
  top: 594px;
  left: 0px;
  height: 594px;
  width: 296px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  z-index: -1;
}
.list-right-shadow {
  position: absolute;
  top: calc(594px - 34px);
  left: 0px;
  height: 628px;
  width: 30px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  z-index: -1;
}
</style>
